<template>
  <div>
    <!-- 1.0 导航栏 -->
    <van-nav-bar
      title="精彩跟帖"
      left-text="返回"
      left-arrow
      @click-left="$router.back()"
    />
    <div class="comment_list">
      <CommentMain
        v-for="item in commentList"
        :key="item.id"
        :commentData="item"
      />
    </div>
  </div>
</template>

<script>
// 导入父评论组件
import CommentMain from "@/components/Comment/Main.vue";
import { getPostCommentById } from "@/api";
export default {
  components: {
    CommentMain,
  },
  data() {
    return {
      commentList: [],
    };
  },
  created() {
    const { id } = this.$route.params;
    getPostCommentById(id).then((res) => {
      this.commentList = res.data.data;
    });
  },
};
</script>

<style lang="less" scoped>
</style>